package server;

import java.io.IOException;

/**
 * @Author: Eric.zhou
 * @Date: 2020/3/27 12:53
 */
public class LagouServlet extends HttpServlet {
    @Override
    public void doGet(Request request, Response response) throws IOException {
        String content = "<h1>LagouServlet get</h1>";
        response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content));
    }

    @Override
    public void doPost(Request request, Response response) {
        String content = "<h1>LagouServlet post</h1>";
        try {
            response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void init() {

    }

    @Override
    public void destory() {

    }
}
